package com.msh.platform.elm.entity;

import javax.persistence.*;

import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

@Entity
@Table(name = "cfg_area", schema = "mscm_dev", catalog = "")
public class CfgArea {
    private int id;
    private Integer pId;
    @ApiModelProperty(value="地区编码，跟id一样，取id也行")
    private String code;
    private String mergeName;
    private String cityCode;
    @ApiModelProperty(value="地区名称")
    private String name;
    private String shortName;
    private Integer levelType;
    private String zipCode;
    private Double lng;
    private Double lat;
    private String pinyin;
    private String delFlag;
    private Integer createTime;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "P_ID")
    public Integer getpId() {
        return pId;
    }

    public void setpId(Integer pId) {
        this.pId = pId;
    }

    @Basic
    @Column(name = "CODE")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "merge_name")
    public String getMergeName() {
        return mergeName;
    }

    public void setMergeName(String mergeName) {
        this.mergeName = mergeName;
    }

    @Basic
    @Column(name = "CITY_CODE")
    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "SHORT_NAME")
    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    @Basic
    @Column(name = "LEVEL_TYPE")
    public Integer getLevelType() {
        return levelType;
    }

    public void setLevelType(Integer levelType) {
        this.levelType = levelType;
    }

    @Basic
    @Column(name = "ZIP_CODE")
    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    @Basic
    @Column(name = "LNG")
    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    @Basic
    @Column(name = "LAT")
    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    @Basic
    @Column(name = "PINYIN")
    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    @Basic
    @Column(name = "DEL_FLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CfgArea cfgArea = (CfgArea) o;
        return id == cfgArea.id &&
                Objects.equals(pId, cfgArea.pId) &&
                Objects.equals(code, cfgArea.code) &&
                Objects.equals(mergeName, cfgArea.mergeName) &&
                Objects.equals(cityCode, cfgArea.cityCode) &&
                Objects.equals(name, cfgArea.name) &&
                Objects.equals(shortName, cfgArea.shortName) &&
                Objects.equals(levelType, cfgArea.levelType) &&
                Objects.equals(zipCode, cfgArea.zipCode) &&
                Objects.equals(lng, cfgArea.lng) &&
                Objects.equals(lat, cfgArea.lat) &&
                Objects.equals(pinyin, cfgArea.pinyin) &&
                Objects.equals(delFlag, cfgArea.delFlag) &&
                Objects.equals(createTime, cfgArea.createTime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, pId, code, mergeName, cityCode, name, shortName, levelType, zipCode, lng, lat, pinyin, delFlag, createTime);
    }
}
